package etl;

import java.util.Date;
import backend.*;

public class ReadingData {
	
	/* **************** *
	 * TRANSFORMED DATA *
	 * **************** */
	// Fact object
	public Fact factObject;
	
	/* ******** *
	 * BAG DATA *
	 * ******** */
	// Bag ID (Data Warehouse internal ID)
	public int bagId = -1;
	// License plate (Lyngsoe Bag ID)
	public long licensePlate = 0;
	// Originating Airport
	public String originatingAirport = null;
	// Route Legs
	public Leg[] routeLegs = new Leg[6];
	// Number of non-null route legs
	public int numRouteLegs = 0;
	
	/* ***************** *
	 * TIME-RELATED DATA *
	 * ********* */
	// First Reading Timestamp
	public Date timestamp = null;
	// Fact ID
	public int factId = -1;
	// Current Bag Status (unknown, en_route, lost)
	public BagStatus status = BagStatus.unknown;
	
	/* ************* *
	 * LOCATION DATA *
	 * ************* */
	// Location ID
	public int locationId = 0;
	// Country Code
	public String countryCode = null;
	// Airport Code
	public String airportCode = null;
	// Tag Reader Location
	public String readerLocation = null;
	// Tag Reader Location Type
	public String readerLocationType = null;
	
	// Data structure for route legs
	public static class Leg {
		
		public String id;
		public String destinationCode;
		public String airlineCode;
		
		public Leg(String dest, String air)
		{
			destinationCode = dest;
			airlineCode = air;
		}
		
	}
	
	public enum BagStatus {
		unknown,
		en_route,
		lost
	}
	
}
